<?php
require('Log.php');
require('connection.php');
require('socketServer.php');
require('packetStream.php');

class MClient extends PacketStream {
	public function onAccept() {
		$this->send(file_get_contents(dirname(__FILE__) . '/../../crossdomain.xml') . "\0");
	}

	public function onPacketReceived($packet) {
		$this->sendPacket($packet);
	}
}

class MServer extends SocketServer {
	public function onConnection($sock) {
		return new MClient($sock);
	}
}

$serv = new MServer('0.0.0.0', 20001);
$serv->start();
